package com.sys.entity;

import java.util.ArrayList;
import java.util.List;

public class Teacher extends Person {
    private String title;
    private List<Course> taughtCourses = new ArrayList<>();

    public Teacher(String id, String name, String gender, String title) {
        super(id, name, gender);
        this.title = title;
    }

    public void openCourse(Course course) {
        taughtCourses.add(course);
        course.setTeacher(this);
        System.out.println(name + "老师开设了" + course.getCourseName() + "课程");
    }
}